package cn.sdut.socket.bio.tcp;

import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;

/**
 * Created by majiatao
 */
public class TcpClient {
    public static void main(String[] args) throws Exception{
        // 建立TCP服务
        Socket socket = new Socket(InetAddress.getLocalHost(), 9191);
        // 获取到Socket的输出流
        OutputStream outputStream = socket.getOutputStream();
        // 利用输出流对象将数据写出
        outputStream.write("服务端你好呀".getBytes());
        socket.close();
    }
}
